from django.conf import settings
from django.conf.urls.defaults import *
from webmapper.geophotos.controls import photo_flow
from webmapper.geophotos.controls import dataset_flow

from webmapper.geophotos.controls import authentication

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^webmapper/', include('webmapper.foo.urls')),
    (r'^photo/(.*)$', photo_flow.PhotoCRUD),
#    (r'^picasa/(.*)$', photo_flow.PicasaCRUD),
#    (r'^googlelogin$', authentication.RequestGoogleLogin),
#    (r'^googlauthed$', photo_flow.PicasaPostLogin),
    (r'^newdata/$', dataset_flow.CreateFromUpload),
    (r'^dataview/$', dataset_flow.CreateFromUpload),
    (r'^dataview/(?P<dsid>.*)$', dataset_flow.ViewDataset),
    (r'^getdata/(?P<dsid>.*)$', dataset_flow.FetchJSON),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/(.*)', admin.site.root),
)

if settings.DEBUG:
  urlpatterns += patterns('',
      (r'^user_media/(?P<path>.*)$',
       'django.views.static.serve',
       {'document_root': '/media/uploaded_media'}),
      )

